//
//  SettingViewController.swift
//  DSHCMerchant
//
//  Created by 罗德良 on 2018/4/16.
//  Copyright © 2018年 袋鼠好车. All rights reserved.
//

import UIKit

class SettingViewController: BaseViewController {

    @IBOutlet var quitBtn: UIButton!
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.navigationController?.navigationBar.isHidden = true
    }
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        self.navigationController?.navigationBar.isHidden = false
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        quitBtn.roundCorner(radius: 5)
        
    }

    @IBAction func changePwdBtnPress(_ sender: UIButton) {
        let changePwdVC = ChangePwdViewController()
        changePwdVC.title = "修改密码"
        self.navigationController?.pushViewController(changePwdVC, animated: true)
        
    }
    
    
    
    @IBAction func editUserInfoBtnPress(_ sender: UIButton) {
        let editUserInfoVC = EditUserInfoViewController()
        editUserInfoVC.title = "修改个人资料"
    self.navigationController?.pushViewController(editUserInfoVC, animated: true)
        
        
    }
    
    
    @IBAction func appVersionInfoBtnPress(_ sender: UIButton) {
        
        let appVersionVC = AppVersionInfoViewController()
        appVersionVC.title = "版本信息"
        self.navigationController?.pushViewController(appVersionVC, animated: true)
    }
    
    
    
    
    @IBAction func quitBtnPress(_ sender: UIButton) {

        UserDefaults.standard.removeObject(forKey: "Token")
        UserDefaults.standard.removeObject(forKey: "bankNum")
        UserDefaults.standard.removeObject(forKey: "belongToBankName")
        UserDefaults.standard.removeObject(forKey: "bankUserName")
        UserDefaults.standard.removeObject(forKey: "IdCard")
    self.navigationController?.popToRootViewController(animated: true)
        
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
